package com.ft.dao;

import com.ft.domain.IndexSmartWear;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ft
 * @since 2022-06-01
 */
@Mapper
public interface IndexSmartWearDao {
        /**
         * 查询首页所有智能穿戴数据
         * @return 返回查询所有数据集合
         */
        @Select("select * from shopping_index_smartwear")
        public List<IndexSmartWear> selectAll();

        /**
         * 添加主页智能穿戴组件数据
         * @param smartwear
         * @return 0失败，1成功
         */
        @Insert("insert into shopping_index_smartwear values(#{id},#{name},#{img},#{datail},#{price})")
        public int addIndexSmartWear(IndexSmartWear smartwear);

        /**
         * 根据id删除数据
         * @param id 主页商品id
         * @return 0失败，1成功
         */
        @Delete("delete from shopping_index_smartwear where id=#{id}")
        public int deleteIndexSmartWear(int id);

}
